export let song_check = {
  namespaced: true,
  state: {
    song_check_data: {
      success: true,
      message: "歌曲加载中。。。"
    },
  },
  actions: {
    getSongCheckData(store, data = {}) {
      let url = "/check/music?id=" + data.id;

      return new Promise((resolve, reject) => {
        axios.get(url).then(({
          data
        }) => {
          store.commit("setSongCheckData", data);
          resolve(true)
        }).catch(error => {
          store.commit("setSongCheckData", {
            "success": false,
            "message": "亲爱的,暂无版权"
          });
          reject(false)
        });
      })

    },
  },
  mutations: {
    setSongCheckData(state, data) {
      state.song_check_data = data;
    },
  }
}
